#include "stdafx.h"
#include "View.h"

using namespace mcore;


bool View::sendInputToGUI(UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch( msg )
	{
		case WM_MOUSEMOVE:
			return mGui->mouseMoved(mgui::Point(LOWORD(lParam), HIWORD(lParam)));
			break;

		case WM_LBUTTONDOWN:
			return mGui->leftButtonDown(mgui::Point(LOWORD(lParam), HIWORD(lParam)));
			break;

		case WM_LBUTTONUP:
			return mGui->leftButtonUp(mgui::Point(LOWORD(lParam), HIWORD(lParam)));
			break;

		case WM_CHAR:
			return mGui->keyPressed(mgui::convert_WM_CHAR_ToKeyEvent(wParam, lParam));
			break;

		case WM_KEYDOWN:
			return mGui->keyPressed(mgui::convert_WM_KEYDOWN_ToKeyEvent(wParam, lParam));
			break;
	}

	return false;
}
